﻿#include "hzpch.h"
#include "UniformBuffer.h"

#include "SourceCode/Renderer/Renderer.h"
#include "SourceCode/Platforms/OpenGL/OpenGLUniformBuffer.h"

namespace Hazal
{
	Ref<CUniformBuffer> CUniformBuffer::Create(uint32_t unSize, uint32_t unBinding)
	{
		switch (CRenderer::GetAPI())
		{
		case CRendererAPI::API::None:
			HZ_ASSERT(false, "RendererAPI::None is not supported!");
			return nullptr;
		case CRendererAPI::API::OpenGL:
			return std::make_shared<COpenGLUniformBuffer>(unSize, unBinding);
		default:
			break;
		}

		HZ_ASSERT(false, "No renderer API is supported!");
		return nullptr;
	}
}